package tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;

import java.util.HashMap;

import org.junit.Before;
import org.junit.Test;

//import application.EffortMultiplier;
//import application.MultiplierEstimation;
import application.Project;

public class ProjectTest {

	private Project p;
	
	@Before
	public void setUp(){
		p = new Project();
	}
	
	@Test
	public void testAddEffortMultiplier() {
		//assertNull(p.addEffortMultiplier(EffortMultiplier.ACAP, MultiplierEstimation.VERY_HIGH));
	}
	
	@Test
	public void testGetEffortMultiplierValue() {
		//p.addEffortMultiplier(EffortMultiplier.ACAP, MultiplierEstimation.VERY_HIGH);
		//assertEquals(0.71,p.getEffortMultiplierValue(EffortMultiplier.ACAP), 0);
	}

	@Test
	public void testGetNonexistantEffortMultiplierValue() {
		try{
		//	p.getEffortMultiplierValue(EffortMultiplier.ACAP);
			//fail("No exception thrown when tryin to access nonexistant multiplier");
		}catch(IllegalArgumentException e){}
	}
	@Test
	public void testCompareWith(){
		Project p1 = new Project();
		p.addCharacteristic("loco", 1337.0);
		p1.addCharacteristic("loco", 1337.0);
		p.addCharacteristic("nothing", 123456.0);
		p.addCharacteristic("rely", 1.0);
		p1.addCharacteristic("rely", 1.0);
		HashMap<String, Double> minValue = new HashMap<String, Double>();
		HashMap<String, Double> maxValue = new HashMap<String, Double>();
		minValue.put("loco", 1000.0);
		maxValue.put("loco", 1500.0);
		minValue.put("rely", 0.0);
		maxValue.put("rely", 3.0);
		
		p.setDeltaValue(minValue, maxValue);
		p1.setDeltaValue(minValue, maxValue);
		int i = p.compareWith(p1);
		assertEquals(i,100);
	}
}
